/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package toesp.entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author satria.sp
 */
@Entity
@Table(name = "pendaftaran")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Pendaftaran.findAll", query = "SELECT p FROM Pendaftaran p"),
    @NamedQuery(name = "Pendaftaran.findByPendaftaranId", query = "SELECT p FROM Pendaftaran p WHERE p.pendaftaranId = :pendaftaranId"),
    @NamedQuery(name = "Pendaftaran.findByPendaftaranTgl", query = "SELECT p FROM Pendaftaran p WHERE p.pendaftaranTgl = :pendaftaranTgl")})
public class Pendaftaran implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "pendaftaran_id")
    private Integer pendaftaranId;
    //--------------------------------------------------------------------------
    @Basic(optional = false)
    @Column(name = "mhs_npm")
    private String mhsNpm;
    @Basic(optional = false)
    @Column(name = "kuliah_id")
    private String kuliahId;
    @Basic(optional = false)
    @Column(name = "tha_id")
    private String thaId;
    //--------------------------------------------------------------------------
    @Column(name = "pendaftaran_tgl")
    @Temporal(TemporalType.TIMESTAMP)
    private Date pendaftaranTgl;
    @JoinColumn(name = "mhs_npm", referencedColumnName = "mhs_npm", insertable = false, updatable = false)
    @ManyToOne
    private Mhs mhs;
    @JoinColumn(name = "kuliah_id", referencedColumnName = "kuliah_id", insertable = false, updatable = false)
    @ManyToOne
    private Kuliah kuliah;
    @JoinColumn(name = "tha_id", referencedColumnName = "tha_id", insertable = false, updatable = false)
    @ManyToOne
    private Tha tha;

    public Pendaftaran() {
    }

    public Pendaftaran(Integer pendaftaranId) {
        this.pendaftaranId = pendaftaranId;
    }

    public Integer getPendaftaranId() {
        return pendaftaranId;
    }

    public void setPendaftaranId(Integer pendaftaranId) {
        this.pendaftaranId = pendaftaranId;
    }

    public Date getPendaftaranTgl() {
        return pendaftaranTgl;
    }

    public void setPendaftaranTgl(Date pendaftaranTgl) {
        this.pendaftaranTgl = pendaftaranTgl;
    } 

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (pendaftaranId != null ? pendaftaranId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Pendaftaran other = (Pendaftaran) obj;
        if ((this.getMhsNpm() == null) ? (other.getMhsNpm() != null) : !this.mhsNpm.equals(other.mhsNpm)) {
            return false;
        }
        if ((this.getKuliahId() == null) ? (other.getKuliahId() != null) : !this.kuliahId.equals(other.kuliahId)) {
            return false;
        }
        if ((this.getThaId() == null) ? (other.getThaId() != null) : !this.thaId.equals(other.thaId)) {
            return false;
        }
        return true;
    }

    /**
     * @return the mhsNpm
     */
    public String getMhsNpm() {
        return mhsNpm;
    }

    /**
     * @param mhsNpm the mhsNpm to set
     */
    public void setMhsNpm(String mhsNpm) {
        this.mhsNpm = mhsNpm;
    }

    /**
     * @return the kuliahId
     */
    public String getKuliahId() {
        return kuliahId;
    }

    /**
     * @param kuliahId the kuliahId to set
     */
    public void setKuliahId(String kuliahId) {
        this.kuliahId = kuliahId;
    }

    /**
     * @return the thaId
     */
    public String getThaId() {
        return thaId;
    }

    /**
     * @param thaId the thaId to set
     */
    public void setThaId(String thaId) {
        this.thaId = thaId;
    }

    /**
     * @return the mhs
     */
    public Mhs getMhs() {
        return mhs;
    }

    /**
     * @param mhs the mhs to set
     */
    public void setMhs(Mhs mhs) {
        this.mhs = mhs;
    }

    /**
     * @return the kuliah
     */
    public Kuliah getKuliah() {
        return kuliah;
    }

    /**
     * @param kuliah the kuliah to set
     */
    public void setKuliah(Kuliah kuliah) {
        this.kuliah = kuliah;
    }

    /**
     * @return the tha
     */
    public Tha getTha() {
        return tha;
    }

    /**
     * @param tha the tha to set
     */
    public void setTha(Tha tha) {
        this.tha = tha;
    }
    
}
